import React,{useRef} from 'react'
import './refcom.css'
export default function RefCom() {
  // let [count,setCount]=useState()
  let div=useRef()
  let show=()=>{
    console.log(div);
    // div.current.style.transform='translateX(0px)'
    div.current.classList.toggle('show')
  }
  return (
    <div>
      <button  onClick={show}>点击获取</button>
      <div ref={div} className="box"></div>
    </div>
  )
}
